import React from 'react';
import Child1 from './components/Child1';
import Child2 from './components/Child2';

class NonPure extends React.Component {

  constructor() {
    super();
    this.state = {
      count: 0,
    };
  }

  onClickAddCount = () => {
    this.setState({
      count: this.state.count + 1,
    });
  }

  render() {
    return (
      <div>
        不带 pure【 { this.state.count } 】
        <Child1 onClick={ this.onClickAddCount } />
        <Child2 />
      </div>
    );
  }
}

export default NonPure;
